interface Window {
    global: any;
    process: any;
    zpack: any;
    ZPack: any;
}

if (window.global == null) {
    window.global = window;
}
if (window.process == null) {
    window.process = {
        pid: 0,
        env: {},
        version: navigator.appVersion,
        platform: navigator.platform,
        execPath: location.href,
    };
}

const zpack = window.zpack = new ZPack();
zpack.load(JSON.parse((document.currentScript as HTMLScriptElement).dataset.config || '{}'));